package com.crm.system.controller.datasearch;

import com.crm.common.model.DataResponse;
import com.crm.common.model.DhResponse;
import com.crm.common.model.Enum.ResponseCodeEnum;
import com.crm.model.qo.datasearch.DataSearchQO;
import com.crm.system.service.datasearch.DataSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Description: 数据搜索
 * @Author lixq-f
 * @Date 2021/5/12
 * @Version V1.0
 **/
@RequestMapping("/dataSearch")
@RestController
public class DataSearchController {


    @Autowired
    private DataSearchService searchService;


    /**
     * @Description: 根据指定条件搜索数据
     * @Param: [searchType, searchName]
     * @Return: com.crm.common.model.DataResponse
     * @Author: lixq-f
     * @Date: 2021/5/12
     **/
    @PostMapping("/searchDataByName")
    public DataResponse searchDataByCondition(@Validated @RequestBody DataSearchQO searchQO) {
        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(), searchService.searchDataByCondition(searchQO));
    }


}
